﻿
namespace GeneticAlgorithms.Tools
{
    /// <summary>
    /// 
    /// </summary>
    public interface IGeneticRandomGenerator
    {
        /// <summary>
        /// Returns a nonnegative random number.
        /// </summary>
        /// <returns>A 32-bit signed integer greater than or equal to zero and less than System.Int32.MaxValue.</returns>
        int Next();

        /// <summary>
        /// Returns a nonnegative random number less than the specified maximum.
        /// </summary>
        /// <param name="maxValue">The exclusive upper bound of the random number to 
        /// be generated. maxValue must be greater than or equal to zero.
        /// </param>
        /// <returns>A 32-bit signed integer greater than or equal to zero, 
        /// and less than maxValue; that is, the range of return values ordinarily 
        /// includes zero but not maxValue. However, if maxValue equals zero, maxValue 
        /// is returned.
        /// </returns>
        /// <exception cref="System.ArgumentOutOfRangeException">Thrown when maxValue is less than zero.</exception>
        int Next(int maxValue);

        /// <summary>
        /// Returns a random number between 0.0 and 1.0.
        /// </summary>
        /// <returns>
        /// A double-precision floating point number greater than or equal to 
        /// 0.0, and less than 1.0.
        /// </returns>
        double NextDouble();

        /// <summary>
        /// Returns a random boolean value, with the given
        /// probability of being <c>true</c>.
        /// </summary>
        /// <param name="probability">
        /// The probability the generated boolean will be <c>true</c>.
        /// </param>
        /// <returns>
        /// A boolean value.
        /// </returns>
        bool NextBool(double probability);

        /// <summary>
        /// Returns a random boolean value, with a 50%
        /// probability of being <c>true</c>.
        /// </summary>
        /// <returns>
        /// A boolean value.
        /// </returns>
        bool NextBool();
    }
}
